﻿
@{
    Layout = null;
}
<style>
    /*.ui-jqgrid .ui-jqgrid-bdiv{
        border-top:1px solid #74e8b5;
        overflow-x:auto;
    }

    .frozen-div, .frozen-bdiv{
        background-color:#fff;
    }*/
</style>
<div id="dv_edit_op">
    <div>
        <table id="gridopList"></table>
    </div>
    <div>
        @Html.Partial("MainOpEdit")
    </div>
</div>
<script>

    function OpListGrid() {
        var $gridList = $("#gridopList");
        $gridList.dataGrid({
            postData: {
                bah: $("#BAH").val(),
                zyh: $("#ZYH").val(),
            },
            url: "/MRHomePage/MainRecord/GetOpGridList",
            autowidth: true,
            height: $(window).height() - 120,
            colModel: [
                { label: "Id", name: "Id", hidden: true },
                { label: "病案号", name: "BAH", width: 60, align: 'left' },
                { label: "住院号", name: "ZYH", width: 60, align: 'left' },
                { label: "手术及<br />操作编码", name: "SSJCZBM", width: 80, align: 'center' },
                { label: "手术及<br />操作日期", name: "SSJCZRQ", width: 130, align: 'center', formatter: "date", formatoptions: { srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s' } },
                { label: "手术<br />级别", name: "SSJB", width: 60, align: 'center' },
                //{ label: "CYQK", name: "CYQK", hidden: true },
                { label: "手术及操作名称", name: "SSJCZMC", width: 150, align: 'center' },
                { label: "SZ", name: "SZ", hidden: true },
                { label: "主刀医生", name: "SZMC", width: 50, align: 'center' },
                { label: "YZ", name: "YZ", hidden: true },
                { label: "I助", name: "YZMC", width: 50, align: 'center' },
                { label: "EZ", name: "EZ", hidden: true },
                { label: "II助", name: "EZMC", width: 50, align: 'center' },
                { label: "QKDJ", name: "QKDJ", hidden: true },
                { label: "QKYHLB", name: "QKYHLB", hidden: true },
                { label: "切口愈<br />合等级", name: "QKYHDJ", width: 50, align: 'center' },
                //{
                //    label: "切口愈<br />合等级", name: "QKYHDJ", width: 50, align: 'center', formatter: function (row, option, data) {
                //        return data.QKDJ + "/" + data.QKYLB;
                //    }
                //},
                { label: "MZFS", name: "MZFS", hidden: true },
                { label: "麻醉方式", name: "MZFSMS", width: 100, align: 'center' },
                { label: "MZYS", name: "MZYS", hidden: true },
                { label: "麻醉医生", name: "MZYSMC", width: 50, align: 'center' },
                { label: "zt", name: "zt", hidden: true },
                {
                    label: "状态", name: "ztsm", width: 50, align: 'center', formatter: function (row, option, data) {
                        if (data.zt == "0") {
                            return "作废";
                        }
                        else {
                            return "正常";
                        }
                    }
                }
            ],
            onSelectRow: function (row) {
                $(".dv-left").show();
                var rowData = $('#gridopList').jqGrid('getRowData', row);
                $("#op_ssdm").val(rowData.SSJCZMC);
                $("#op_ssdm").attr("attr-ssdm", rowData.SSJCZBM);
                $("#op_ssdm").attr("attr-ssjb", rowData.SSJB);
                $("#op_ssrq").val(rowData.SSJCZRQ);
                $("#op_ssdm").val(rowData.SSJCZMC);
                $("#op_yhdj").val(rowData.QKDJ).trigger("change");
                $("#op_yhlb").val(rowData.QKYHLB).trigger("change");
                $("#op_mzfs").val(rowData.MZFS).trigger("change");
                $("#op_zdys").val(rowData.SZMC);
                $("#op_zdys").attr("data-StaffGh",rowData.SZ);
                $("#op_sszl1").val(rowData.YZMC);
                $("#op_sszl1").attr("data-StaffGh", rowData.YZ);
                $("#op_sszl2").val(rowData.EZMC);
                $("#op_sszl2 ").attr("data-StaffGh", rowData.EZ);
                $("#op_mzys").val(rowData.MZYSMC);
                $("#op_mzys").attr("data-StaffGh", rowData.MZYS);
                $("#op_rowid").val(row);
            },
            loadComplete: function () {

            },
            /*caption: "手术列表",*/
            
            //rowNum: 15,
            //pager: "#gridzdPager",
            viewrecords: false,
            shrinkToFit: false,
            autoScroll:true

        });
       // jQuery("#gridopList").jqGrid('navGrid', '#gridzdPager', { edit: false, add: false, del: false });
        jQuery("#gridopList").jqGrid('sortableRows');

    }


</script>